<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>model</title>
	<meta name="author" content="Stark" />
	<!-- Date: 2018-10-24 -->
	<style type="text/css">
		.selected {
			background: #fff;
			color: #f00;
		}
		#imgElement {
			width: 400px;
		}
		#movie_name {
			position: relative;
			top: 40px;
			border: 1px solid red;
			background: #a43;
			opacity: 0.7;
			color: #fff;
		}
		#move_name {
			
		}
	</style>
	<script type="text/javascript" src="jquery-1.8.3.js"></script>
	<script type="text/javascript">
		$(function(){
			var index = 0;
			
			var imgInit = $("#imgElement img")
			.each(function(n){
				$("#content").append("<span>"+(n+1)+"</span>&nbsp;");
			}).css("display","none").filter(":eq("+(index++)+")").show();
			
			$("#movie_name").html(imgInit.attr("alt"));
			
			$("#content span").click(function() {
				var ele = $(this).html();
				index = (ele--);
				change();
			});
			
			$("#content span:eq(0)").addClass("selected");
			function change() {
				var img = $("#imgElement img").css("display","none").filter(":eq("+(index)+")").fadeIn('slow');
				$("#movie_name").html(img.attr("alt"));
				
				$("#content span").removeClass("selected").filter(":eq("+index+")").addClass("selected");
				index++;
				if(index>=$("#imgElement img").size()){
					index=0;
				}
			}
			setInterval(change,2000);
			
		});
	</script> 
</head>
<body>
	<div id="content"></div>
	<div id="imgElement">
		<div id="movie_name">电影名称</div>
		<img src="movie/1.jpg" alt="测试1" height="500" />
		<img src="movie/2.jpg" alt="测试2" height="500" />
		<img src="movie/3.jpg" alt="测试3" height="500" />
		<img src="movie/4.jpg" alt="测试4" height="500" />
		<img src="movie/5.jpg" alt="测试5" height="500" />
	</div>
</body>
</html>

